package pl.perseus.service.passlist;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import pl.perseus.dao.IPasslistDao;
import pl.perseus.model.Passlist;
import pl.perseus.model.User;

@Service
@Transactional
public class PassListService implements IPassListService {

	@Autowired
	IPasslistDao passListDao;
	
	@Override
	public Passlist insertPassList(Passlist passlist){
		return passListDao.insertPasslist(passlist);
	}
	
	@Override
	public void deletePassList(Passlist passlist){
		passListDao.deletePassList(passlist);
	}
	
	@Override
	public Passlist getById(Long id){
		return passListDao.selectByIdPasslist(id);
	}
	
	@Override
	public Passlist getFirstUnusedPassListForUser(User user){
		return passListDao.getFirstUnusedPassListForUser(user);
	}
	
	@Override 
	public Passlist updatePassList(Passlist passlist){
		return passListDao.updatePassList(passlist);
	}
	
}
